﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using StarcraftDemo4;

namespace StarcraftDemo4Site.Controllers
{ 
    public class GameController : Controller
    {
        private SC2ResultsGamesEntities db = new SC2ResultsGamesEntities();

        //
        // GET: /Game/

        public ViewResult Index()
        {
            return View(db.Games.ToList());
        }

        //
        // GET: /Game/Details/5

        public ViewResult Details(int id)//this is whats passed to the controller action 
        {
            var sameGame =
                from one in db.Games
                where one.GameId==id
                select one;
            return View(sameGame);//this is what the view gets.
        }
    }
}